package stringDemo;

import java.util.Scanner;

//统计字符次数
public class StringTest3 {
    public static void main(String[] args) {
        int[]reslt=getCount();
        System.out.println("数字个数:"+reslt[0]);
        System.out.println("小写字母个数:"+reslt[1]);
        System.out.println("大写字母个数:"+reslt[2]);
    }

    private static int[] getCount() {
        Scanner scanner=new Scanner(System.in);
        String input=scanner.nextLine();
        char[]inputChar=input.toCharArray();
        int numCount=0,AZCount=0,azCount=0;
        for (int i = 0; i <inputChar.length ; i++) {
            if ('0'<=inputChar[i]&&inputChar[i]<='9'){
                numCount++;
            }else if ('a'<=inputChar[i]&&inputChar[i]<='z'){
                azCount++;
            }else if ('A'<=inputChar[i]&&inputChar[i]<='Z'){
                AZCount++;
            }
        }
        int[]result={numCount,azCount,AZCount};
        return result;
    }

}
